]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
popupMenu/switch: Follow "show-status-shapes" setting
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 10 Jan 2024 18:53:58 +0000 (19:53 +0100)
committerMarge Bot <marge-bot@gnome.org>
Wed, 17 Jan 2024 04:30:11 +0000 (04:30 +0000)
Whether or not switches include shapes to indicate their ON/OFF
state is currently controlled by the stylesheet.

However there are use cases for both using the HighContrast style
without shapes, and for using shapes with the regular styesheet,
so follow the newly added "show-status-shapes" setting instead.

https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2675

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3107>

js/ui/popupMenu.js

index 9886649ab754dc6d8d49531e50ba43f29e35354d..3842d821816cda5623b3a1b908978feb05bd33fe 100644 (file)
@@ -368,7 +368,11 @@ export const Switch = GObject.registerClass({
         });
         box.add_child(this._offIcon);
 
-        St.Settings.get().connectObject('notify::high-contrast',
+        this._a11ySettings = new Gio.Settings({
+            schema_id: 'org.gnome.desktop.a11y.interface',
+        });
+
+        this._a11ySettings.connectObject('changed::show-status-shapes',
             () => this._updateIconOpacity(),
             this);
         this.connect('notify::state',
@@ -377,7 +381,7 @@ export const Switch = GObject.registerClass({
     }
 
     _updateIconOpacity() {
-        const activeOpacity = St.Settings.get().high_contrast
+        const activeOpacity = this._a11ySettings.get_boolean('show-status-shapes')
             ? 255. : 0.;
 
         this._onIcon.opacity = this.state